<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>个人信息 - Nkuvr 后台管理系统</title>
    <meta name="author" content="yinqi">
    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <link href="../../css/materialdesignicons.min.css" rel="stylesheet">
    <link href="../../css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside th:replace="fragment/_fragment::navbar"></aside>


        <!--头部信息-->
        <header th:replace="fragment/_fragment::sidebar"></header>


        <!--页面主要内容-->
        <!--<main class="lyear-layout-content">-->

            <!--<div class="container-fluid">-->

                <!--<div class="row">-->
                    <!--<div class="col-lg-12">-->
                        <!--<div class="card">-->
                            <!--<div class="card-body">-->

                                <!--<form action="#!" method="post" class="row">-->
                                    <!--<input type="hidden" id="id" name="id" th:value="${userInfo.id}">-->
                                    <!--<div class="form-group col-md-12">-->
                                        <!--<label for="studentNumber">学号</label>-->
                                        <!--<input type="text" class="form-control" id="studentNumber" name="studentNumber"-->
                                               <!--disabled="disabled" th:value="${userInfo.studentNumber}"/>-->
                                    <!--</div>-->


                                    <!--<div class="form-group col-md-12">-->
                                        <!--<label for="realName">姓名</label>-->
                                        <!--<input type="text" class="form-control" id="realName" name="realName"-->
                                               <!--th:value="${userInfo.realName}"/>-->
                                    <!--</div>-->

                                    <!--<div class="form-group col-md-12">-->
                                        <!--<label for="gender">性别</label>-->
                                        <!--<div class="clearfix">-->
                                            <!--<label class="lyear-radio radio-inline radio-primary">-->
                                                <!--<input type="radio" name="gender" th:value="0"-->
                                                       <!--th:checked="${userInfo.gender == 0}"><span>男</span>-->
                                            <!--</label>-->
                                            <!--<label class="lyear-radio radio-inline radio-primary">-->
                                                <!--<input type="radio" name="gender" th:value="1"-->
                                                       <!--th:checked="${userInfo.gender == 1}"><span>女</span>-->
                                            <!--</label>-->
                                        <!--</div>-->
                                    <!--</div>-->


                                    <!--<div class="form-group col-md-12">-->
                                        <!--<a class="btn btn-primary ajax-post" target-form="add-form"-->
                                           <!--href="javascript:void(0);" onclick="return doEdit();">确 定</a>-->
                                        <!--<button type="button" class="btn btn-default"-->
                                                <!--onclick="javascript:window.history.back(-1);return false;">返 回-->
                                        <!--</button>-->
                                    <!--</div>-->
                                <!--</form>-->

                            <!--</div>-->
                        <!--</div>-->
                    <!--</div>-->

                <!--</div>-->

            <!--</div>-->

        <!--</main>-->

    </div>
</div>

<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="../../js/main.min.js"></script>
<script src="../../layer/layer.js"></script>
<script type="text/javascript">
    function doEdit() {
        var id = $('#id').val();
        var realName = $('#realName').val();
        var gender = $('input:radio:checked').val();
        var loadingIndex = null;

        layer.confirm("确定保存吗？", {btn: ['确认', '取消']}, function () {
            $.ajax({
                type: "post",
                url: "/user/doProfileEdit",
                async: false,
                dataType: "json",
                data: {
                    "id": id,
                    "realName": realName,
                    "gender": gender,
                },
                beforeSend: function () {
                    loadingIndex = layer.msg("处理中", {icon: 16});
                },
                success: function (result) {
                    layer.close(loadingIndex);
                    if (result.success) {
                        layer.msg("保存成功", {time: 1000, icon: 6});
                        window.location.href = "/user/profile/" + id;
                    } else {
                        layer.msg("保存失败，请重新操作", {time: 1000, icon: 5, shift: 6});
                    }
                }
            });
            return false;
        });
    }
</script>
</body>
</html>